package com.qianmi.cloud.controller.goods;

import com.qianmi.cloud.app.GoodsQueryProvider;
import com.qianmi.cloud.request.GoodsQueryRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description
 * @Author caichao【OF3379】
 * @Date 2:04 PM 1/15/22
 */
@Slf4j
@RestController
public class GoodsController {

    @Autowired
    private GoodsQueryProvider goodsQueryProvider;

    //    @PreAuthorize("hasAuthority('ROLE_ADMIN')")
    @GetMapping(value = "/query/goods", name = "查询商品信息")
    public Object queryGoods() {
        log.info("成功的信息");

        log.error("错误的信息~~");

        GoodsQueryRequest goodsQueryRequest = new GoodsQueryRequest();
        return goodsQueryProvider.queryGoods(goodsQueryRequest);
    }
}
